﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Dracham.MapEditor.Zones;

namespace Dracham.MapEditor.TileEvents
{
    public partial class frmInsertMobileObjectSpawnPoint : Form
    {
        public Int32 Id
        {
            get
            {
                return (Int32)this.nudId.Value;
            }
        }

        public Int32 Interval
        {
            get
            {
                return (Int32)this.nudInterval.Value;
            }
        }

        public String Type
        {
            get
            {
                return this.cbType.SelectedItem.ToString();
            }
        }

        public frmInsertMobileObjectSpawnPoint(ZoneTile zt)
        {
            InitializeComponent();

            if (zt.SpawnPoint != null)
            {
                this.nudInterval.Value = zt.SpawnPoint.Interval;
                this.nudId.Value = zt.SpawnPoint.Id;

                foreach (String type in cbType.Items)
                {
                    if (type == zt.SpawnPoint.Type)
                    {
                        cbType.SelectedItem = type;
                    }
                }
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
